package cn.iocoder.yudao.module.system.dal.mysql.areaserve;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.areaserve.vo.AreaResourcesPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.areaserve.AreaResourcesDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface AreaResourcesMapper extends BaseMapperX<AreaResourcesDO> {

    default PageResult<AreaResourcesDO> selectPage(AreaResourcesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AreaResourcesDO>()
                .eqIfPresent(AreaResourcesDO::getOfficeName, reqVO.getOfficeName())
                .eqIfPresent(AreaResourcesDO::getAreaName, reqVO.getAreaName())
                .orderByDesc(AreaResourcesDO::getId));
    }
}
